package learning;

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class Test {
	public static void main(String[] args) {
		try {
			ByteArrayInputStream bis=new ByteArrayInputStream("Icomefromchina".getBytes());
			System.out.println((char)bis.read());
			System.out.println((char)bis.read());
			System.out.println((char)bis.read());
			bis.mark(2);
			System.out.println((char)bis.read());
			System.out.println((char)bis.read());
			System.out.println((char)bis.read());
			bis.reset();
			System.out.println((char)bis.read());
			System.out.println((char)bis.read());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
    
}
